<?php
namespace Addons;

/**
 * 消息提示
 */
class ShowMsg {
	/**
	 * 消息提示1
	 */
	public function showMsg(){
		$notice=session('notice');//获取提示消息
		if($notice){
			echo '<script>
				$(function(){
					$.noty({"text":"'.$notice['msg'].'","layout":"top","type":"'.$notice['type'].'","timeout":"1000"});
				});
				</script>';
			session('notice',null);
		}
	}
	
	/**
	 * 消息提示2
	 */
	public function ShowMsg2(){
		$notice=session('notice2');//获取提示消息
		if($notice){
			$html='
				<div id="mask"></div>
				<div id="notice2">
					<div class="ttBox">
						<span class="tt">友情提示</span>
					</div>
					<div class="txtBox">
						<div class="bigIcon"></div>
						<p></p>
					</div>
					<div class="btnArea">
						<div class="btnGroup">
							<a class="sgBtn ok">确定</a>
							<a class="sgBtn cancel" onclick="cancel()">取消</a>
						</div>
					</div>
				</div>
				<script>
					notice2Init();
					$("#mask").css("display","block");
					$("#notice2").css("display","block");
					$("#notice2 .txtBox p").html("'.$notice.'");
					$("#notice2 .sgBtn.ok").click(function(){
						$("#mask").css("display","none");
						$("#notice2").css("display","none");
						window.location.href="/User/Payment";
					});
				</script>
				';
			echo $html;
			session('notice2',null);
		}
	}
}

?>